﻿<%@ Page Title="Aircraft Seat Map" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AircraftSeatMap.aspx.cs" Inherits="IFD2.AircraftSeatMap" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <asp:Label ID="Label1" runat="server" Text="Tail No.:" meta:resourcekey="TailNo"></asp:Label>
            <asp:Label ID="lblTailNo" runat="server" Font-Bold="True"></asp:Label>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:Table ID="tabSeatMap" runat="server" Font-Names="Courier New" style="table-layout:fixed;word-wrap:break-word;white-space:nowrap;"></asp:Table>
                    </div>
                    <asp:Label ID="Label10" runat="server" Text="Legend" meta:resourcekey="Legend" Font-Italic="true"></asp:Label><br />

                    <div class="btn-group">
                        <asp:Button ID="btnDelete" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnDelete_Click" Text="Delete Cell"  meta:resourcekey="DeleteCell" Width="100px" />
                        <asp:Button ID="btnClear" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnClear_Click" Text="Clear"  meta:resourcekey="Clear" Width="100px" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
                    <br />
                    <div class="well well-sm">
                        <asp:Label ID="Label8" runat="server" Text="Copy to New Aircraft:" Font-Bold="True" meta:resourcekey="NewTailNo"></asp:Label>&nbsp;
                        <asp:DropDownList ID="lstNewTailNos" runat="server" DataSourceID="SqlNewTailNo" DataTextField="tail_no" DataValueField="tail_no"></asp:DropDownList>
                        <asp:Button ID="btnCopy" runat="server" CssClass="btn btn-sm btn-default" Text="Copy" OnClick="btnCopy_Click"  meta:resourcekey="Copy" /><br />
                        <asp:Label ID="lblErrCopy" runat="server" CssClass="ifdMessage"></asp:Label>

                        <asp:SqlDataSource ID="SqlNewTailNo" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                            SelectCommand="bll_aircraft_get_same_type_aircrafts" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lblTailNo" Name="tail_no" PropertyName="Text" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                    <br />
                    <div class="well well-sm">
                        <asp:Label ID="Label13" runat="server" Font-Bold="True" Text="New Cell" meta:resourcekey="NewCell"></asp:Label>
                        <div class="form-group">
                        <asp:HyperLink ID="lnkDownload" runat="server" NavigateUrl="SeatMap.xls" meta:resourcekey="DownloadFile">Download seatmap file...</asp:HyperLink>
                        </div>
                        <br class="hidden-xs" />
                        <div class="form-group">
                        <asp:Label ID="Label2" runat="server" Text="X="></asp:Label>
                        <asp:TextBox ID="txtX" runat="server" Width="42px" MaxLength="3"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label3" runat="server" Text="Y="></asp:Label>
                        <asp:TextBox ID="txtY" runat="server" Width="41px" MaxLength="1"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label6" runat="server" Text="Type:" meta:resourcekey="Type"></asp:Label>
                        <asp:DropDownList ID="lstSpaceTypes" runat="server">
                            <asp:ListItem Value="S" meta:resourcekey="Seat" Text="Seat"></asp:ListItem>
                            <asp:ListItem Value="R" meta:resourcekey="Road" Text="Road"></asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label21" runat="server" Text="Seat Row:" meta:resourcekey="SeatRow"></asp:Label>
                        <asp:TextBox ID="txtRow" runat="server" Width="30px" MaxLength="3"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label22" runat="server" Text="Col:" meta:resourcekey="Col"></asp:Label>
                        <asp:DropDownList ID="lstCols" runat="server">
                            <asp:ListItem>A</asp:ListItem>
                            <asp:ListItem>B</asp:ListItem>
                            <asp:ListItem>C</asp:ListItem>
                            <asp:ListItem>D</asp:ListItem>
                            <asp:ListItem>E</asp:ListItem>
                            <asp:ListItem>F</asp:ListItem>
                            <asp:ListItem>G</asp:ListItem>
                            <asp:ListItem>H</asp:ListItem>
                            <asp:ListItem>I</asp:ListItem>
                            <asp:ListItem>J</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <br class="hidden-xs" />
                        <div class="form-group">
                        <asp:Label ID="Label11" runat="server" Text="Load Area:" meta:resourcekey="LoadArea"></asp:Label>
                        <asp:DropDownList ID="lstLoadArea" runat="server">
                            <asp:ListItem Value="A">OA</asp:ListItem>
                            <asp:ListItem Value="B">OB</asp:ListItem>
                            <asp:ListItem Value="C">OC</asp:ListItem>
                            <asp:ListItem Value="D">OD</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label7" runat="server" Text="Cabin:" meta:resourcekey="Cabin"></asp:Label>
                        <asp:DropDownList ID="lstAcCabins" runat="server" DataSourceID="sqlAcCabins" DataTextField="cabin" DataValueField="cabin" AutoPostBack="True" ></asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label12" runat="server" Text="Class:" meta:resourcekey="Class"></asp:Label>
                        <asp:DropDownList ID="lstClasses" runat="server" DataSourceID="sqlClasses" DataTextField="class" DataValueField="class" ondatabound="lstClasses_DataBound">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label9" runat="server" Text="Seat Type:"  meta:resourcekey="SeatType"></asp:Label>
                        <asp:TextBox ID="txtSeatType" runat="server" MaxLength="2" Width="26px"  Text="*"></asp:TextBox>
                        </div>
                        <br class="hidden-xs" />
                        <div class="form-group">
                        <asp:Label ID="Label19" runat="server" Text="Attributes:" meta:resourcekey="Attributes" MaxLength="10"></asp:Label>
                        <asp:TextBox ID="txtAttributes" runat="server" MaxLength="10" Width="116px"></asp:TextBox>
                        <asp:Label ID="Label20" runat="server" Text="(I)nfant,(L)ongLeg,(E)mergencyExit" meta:resourcekey="legAttributes" Font-Italic="true"></asp:Label>
                        </div>
                        <br class="hidden-xs" />
                        <asp:Button ID="btnAdd" runat="server" CssClass="btn btn-sm btn-default" OnClick="btnAdd_Click" Text=" Add "  meta:resourcekey="Add" /><br />
                        <asp:Label ID="lblErrAdd" runat="server" CssClass="ifdMessage"></asp:Label>

                        <asp:SqlDataSource ID="sqlAcCabins" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                            SelectCommand="bll_aircraft_get_cabin_codes" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="lblTailNo" Name="tail_no" PropertyName="Text" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="sqlClasses" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" 
                            SelectCommand="bll_airline_get_class_codes_by_cabin" SelectCommandType="StoredProcedure">
                            <SelectParameters>
                                <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                                <asp:ControlParameter ControlID="lstAcCabins" Name="cabin" PropertyName="SelectedValue" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </div>
                    <br />
                    <div class="well well-sm">
                        <asp:Label ID="Label14" runat="server" Font-Bold="True" Text="Batch Changing" meta:resourcekey="BatchChanging"></asp:Label>
                        <br />
                        <div class="form-group">
                        <asp:Label ID="Label15" runat="server" Text="Change Field:" meta:resourcekey="ChangeField"></asp:Label>
                        <asp:DropDownList ID="lstEditTarget" runat="server">
                            <asp:ListItem Value="S" meta:resourcekey="Seat_type1">Seat Type</asp:ListItem>
                            <asp:ListItem Value="C" meta:resourcekey="class1">Class</asp:ListItem>
                            <asp:ListItem Value="A" meta:resourcekey="Attributes1">Attributes</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        =<asp:TextBox ID="txtNewValue" runat="server" MaxLength="10" Width="124px">*</asp:TextBox>
                        <asp:Label ID="Label17" runat="server" Text="[* = No Control]" meta:resourcekey="legNoControl" Font-Italic="true"></asp:Label>
                        </div>
                        <br class="hidden-xs"/>
                        <asp:Label ID="Label16" runat="server" Text="Where:" meta:resourcekey="Where"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtWhere" runat="server" Height="69px" MaxLength="100" TextMode="MultiLine" style="max-width:555px;width:100%;">col in (&#39;A&#39;,&#39;K&#39;) and row between 9 and 20 and cabin=&#39;Y&#39;and attributes like &#39;%E%&#39;</asp:TextBox>
                        <br />
                        <asp:Label ID="Label18" runat="server" Text="Avail key words: row,col,seat_type,attributes,class,cabin,load_area" meta:resourcekey="legFields" Font-Italic="true"></asp:Label>
                        <br class="hidden-xs" />
                        <asp:Button ID="btnChange" runat="server" CssClass="btn btn-sm btn-default" Text="Change" onclick="btnChange_Click" meta:resourcekey="Change"/><br />
                        <asp:Label ID="lblErrChange" runat="server" CssClass="ifdMessage"></asp:Label>
                    </div>
                    
                </div>
            </div>
        </div>
    </div>

    </div>
    </ContentTemplate></asp:UpdatePanel>
    </form>

</asp:Content>
